package com.qf.service.impl;

import com.qf.dao.DeptDao;
import com.qf.dao.impl.DeptDaoImpl;
import com.qf.pojo.Dept;
import com.qf.service.DeptService;

import java.util.List;

public class DeptServiceImpl implements DeptService {

    DeptDao deptDao=new DeptDaoImpl();
    //查询所有部门信息

    @Override
    public List<Dept> findDeptAll() {
        return deptDao.findDeptAll();
    }

    //根据名称查询

    @Override
    public List<Dept> findDeptByDname(String dname) {
        return deptDao.findDeptByDname(dname);
    }

    @Override
    public int addDept(Dept dept) {
        return deptDao.addDept(dept);
    }
//根据id查询

    @Override
    public List<Dept> findDeptById(int id) {
        return deptDao.findDeptById(id);
    }

    //删除部门信息

    @Override
    public int deleteDeptBYDname(String dname) {
        return deptDao.deleteDeptBYDname(dname);
    }
}
